﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using MySql.Data.MySqlClient;

public partial class Solicitudes : Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
      
        //Acciones iniciales para verificar usuario loggeado y visibilidad de menus
        var master = Master as SiteMaster;
        if (master != null)
        {
            master.AccionesIniciales();
            System.Int32 id1 = (System.Int32)Page.Session["userId"];
            string usuarioId = id1.ToString();

            SolicitudesManager solicitudesManager = new SolicitudesManager();
            List<string> solicitudes = solicitudesManager.ObtenerSolicitudesUsuario(usuarioId);

            contenido.Text = "<table><tbody>";
            contenido.Text += "<tr> <td>Numero de solicitud</td> <td>Servicio</td> <td>Motivo</td> <td>Fecha</td> <td>Estatus</td> <td>Departamento</td> </tr>";

            foreach (string solicitud in solicitudes)
            {
                contenido.Text += solicitud;
            }

            contenido.Text += "</tbody></table>";
        }

    } 

}